import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show rootBundle;
import 'dart:convert';
import 'package:flutter/widgets.dart';

import 'dart:ui';

bool isSimplifiedChinese() {
  final locale = PlatformDispatcher.instance.locale;
  return locale.languageCode == 'zh' &&
      (locale.scriptCode == 'Hans' || locale.countryCode == 'CN');
}

bool isChineseLocale() {
  final locale = PlatformDispatcher.instance.locale;
  return locale.languageCode == 'zh';
}

bool isTraditionalChinese() {
  final locale = PlatformDispatcher.instance.locale;
  // 繁体中文环境可能来自台湾、香港或澳门
  return locale.languageCode == 'zh' && 
         (locale.countryCode == 'TW' || locale.countryCode == 'HK' || locale.countryCode == 'MO');
}

String getLanguageCode() {
  // 根据语言环境动态设置 languageCode
  if (isSimplifiedChinese()) {
    return '';  // 简体中文时传空
  } else if (isTraditionalChinese()) {
    return 'zh-hant';  // 繁体中文时传 'zh-hant'
  } else {
    return 'en';  // 英文时传 'en'
  }
}

class AppLocalizations {
  AppLocalizations(this.locale);

  final Locale locale;

  static AppLocalizations? of(BuildContext context) {
    return Localizations.of<AppLocalizations>(context, AppLocalizations);
  }

  static const LocalizationsDelegate<AppLocalizations> delegate =
      _AppLocalizationsDelegate();

  static List<Locale> supportedLocales() {
    return [Locale('zh', 'CN'), Locale('zh', 'TW'), Locale('en', 'US')];
  }

 static Future<AppLocalizations> load(Locale locale) async {
  String jsonString;
  if (locale.languageCode == 'zh') {
    final isSimplified = locale.countryCode == 'CN' || locale.toString().contains('Hans');
    final isTraditional = locale.countryCode == 'TW' || locale.countryCode == 'HK' || locale.toString().contains('Hant');

    if (isSimplified) {
      jsonString = await rootBundle.loadString('lib/l10n/intl_zh_Hans.json');
    } else if (isTraditional) {
      jsonString = await rootBundle.loadString('lib/l10n/intl_zh_Hant.json');
    } else {
      jsonString = await rootBundle.loadString('lib/l10n/intl_en.json');
    }
  } else {
    jsonString = await rootBundle.loadString('lib/l10n/intl_en.json');
  }

  final Map<String, dynamic> jsonMap = jsonDecode(jsonString);
  return AppLocalizations(locale).._localizedStrings = jsonMap;
}

  late Map<String, dynamic> _localizedStrings;

  String get home => _localizedStrings['home']!;
  String get category => _localizedStrings['category']!;
  String get message => _localizedStrings['message']!;
  String get order => _localizedStrings['order']!;
  String get profile => _localizedStrings['profile']!;
  String get pleaseEnterProduct => _localizedStrings['PleaseEnterProduct']!;
  String get notempty => _localizedStrings['Notempty']!;
  String get newProduct => _localizedStrings['NewProduct']!;
  String get hotList => _localizedStrings['HotList']!;
  String get tooManyGoods => _localizedStrings['TooManyGoods']!;
  String get discountMoreQuicklyBuy => _localizedStrings['DiscountMoreQuicklyBuy']!;
  String get news => _localizedStrings['News']!;
  String get onlineCustomer => _localizedStrings['OnlineCustomer']!;
  String get hellodear => _localizedStrings['Hellodear']!;
  String get twoMinutesAgo => _localizedStrings['Two minutes ago']!;
  String get messageCenter => _localizedStrings['Message center']!;
  String get accountBalance => _localizedStrings['AccountBalance']!;
  String get coupon => _localizedStrings['Coupon']!;
  String get get => _localizedStrings['Get']!;
  String get afterClaiming => _localizedStrings['After claiming']!;
  String get accountSecurity => _localizedStrings['AccountSecurity']!;
  String get account => _localizedStrings['Account']!;
  String get feedbacks => _localizedStrings['Feedbacks']!;
  String get safetyLevel => _localizedStrings['SafetyLevel']!;
  String get register => _localizedStrings['Register']!;
  String get followUs => _localizedStrings['Follow us']!;
  String get contactUs => _localizedStrings['Contact us']!;
  String get allRightsReserved => _localizedStrings['All rights reserved']!;
  String get andAllRightsReserved => _localizedStrings['And All rights reserved']!;
  String get companyAddress => _localizedStrings['Company address']!;
  String get hotSearches => _localizedStrings['Hot searches']!;
  String get hotProduct => _localizedStrings['Hot product']!;
  String get pleaseEnterKeywordsFirst => _localizedStrings['Please enter keywords first']!;
  String get relatedGoods => _localizedStrings['Related goods']!;
  String get totalPrice => _localizedStrings['Total price：']!;
  String get buyNow => _localizedStrings['Buy now']!;
  String get contactCustomer => _localizedStrings['ContactCustomer']!;
  String get newPeopleCanOnlyRegister => _localizedStrings['New people can only register']!;
  String get surpriseCoupon => _localizedStrings['Surprise Coupon']!;
  String get limitedGrab => _localizedStrings['Limited grab']!;
  String get rechargeType => _localizedStrings['Recharge type']!;
  String get faceValue => _localizedStrings['Face value']!;
  String get evaluate => _localizedStrings['evaluate']!;
  String get myEvaluation => _localizedStrings['MyEvaluation']!;
  String get overseasServiceAgency => _localizedStrings['Overseas service agency']!;
  String get close => _localizedStrings['close']!;
  String get recommended => _localizedStrings['Recommended']!;
  String get score => _localizedStrings['Score']!;
  String get marketPrice => _localizedStrings['MarketPrice:']!;
  String get rating => _localizedStrings['Rating']!;
  String get aboutUs => _localizedStrings['AboutUs']!;
  String get clearCache => _localizedStrings['ClearCache']!;
  String get clearCacheSuccess => _localizedStrings['ClearCacheSuccess']!;
  String get closeAccount => _localizedStrings['CloseAccount']!;
  String get helloDearHowCanIHelpYou => _localizedStrings['Hellodear']!;
  String get welcome => _localizedStrings['Welcome']!;
  String get welcome2 => _localizedStrings['Welcome2']!;
  String get phoneNumber => _localizedStrings['PhoneNumber']!;
  String get logindesc => _localizedStrings['LoginDesc']!;
  String get mailbox => _localizedStrings['Mailbox']!;
  String get pleaseEnter => _localizedStrings['PleaseEnter']!;
  String get verificationCode => _localizedStrings['VerificationCode']!;
  String get send => _localizedStrings['Send']!;
  String get sendCode => _localizedStrings['SendCode']!;
  String get setThePassword => _localizedStrings['Set the password']!;
  String get iHaveReadAndAgree => _localizedStrings['I have read and agree']!;
  String get userAgreement => _localizedStrings['User Agreement']!;
  String get changePhone => _localizedStrings['Change Phone']!;
  String get privacyAgreement => _localizedStrings['Privacy Agreement']!;
  String get disclaimer => _localizedStrings['Disclaimer']!;
  String get termsOfService => _localizedStrings['Terms of Service']!;
  String get refundPolicy => _localizedStrings['Refund Policy']!;
  String get atOnce => _localizedStrings['At once']!;
  String get login => _localizedStrings['Login']!;
  String get alreadyHaveAnAccount => _localizedStrings['Already have an account？']!;
  String get atLogin => _localizedStrings['At Login']!;
  String get atRegister => _localizedStrings['At Register']!;
  String get forgotPassword => _localizedStrings['Forgot password?']!;
  String get haveAProblem => _localizedStrings['Have a problem?']!;
  String get password => _localizedStrings['password']!;
  String get enterTheAreaCode => _localizedStrings['EnterTheAreaCode']!;
  String get cancel => _localizedStrings['Cancel']!;
  String get accountNotRegistered => _localizedStrings['Account not registered']!;
  String get registerNow => _localizedStrings['Register Now']!;
  String get all => _localizedStrings['All']!;
  String get pendingPayment => _localizedStrings['PendingPayment']!;
  String get pendingShipment => _localizedStrings['PendingShipment']!;
  String get pendingDelivery => _localizedStrings['PendingDelivery']!;
  String get completeds => _localizedStrings['Completeds']!;
  String get orderNumber => _localizedStrings['Order number']!;
  String get orderIdAlreadyCopy => _localizedStrings['OrderId already copy']!;
  String get copy => _localizedStrings['copy']!;
  String get type => _localizedStrings['type']!;
  String get total => _localizedStrings['total']!;
  String get none => _localizedStrings['None']!;
  String get filterByTime => _localizedStrings['Filter by time']!;
  String get last1Month => _localizedStrings['Last 1 month']!;
  String get last3Months => _localizedStrings['Last 3 months']!;
  String get last6Months => _localizedStrings['Last 6 months']!;
  String get confirm => _localizedStrings['Confirm']!;
  String get success => _localizedStrings['Success']!;
  String get feedback => _localizedStrings['Feedback']!;
  String get description => _localizedStrings['Description']!;
  String get contactInformation => _localizedStrings['Contact Information']!;
  String get submit => _localizedStrings['Submit']!;
  String get optionalSoWeCanContactYou => _localizedStrings['Optional，So we can contact you']!;
  String get personadata => _localizedStrings['Personal data']!;
  String get set => _localizedStrings['Set']!;
  String get save => _localizedStrings['Save']!;
  String get quit => _localizedStrings['Quit']!;
  String get notUsed => _localizedStrings['Not Used']!;
  String get used => _localizedStrings['Used']!;
  String get expireds => _localizedStrings['Expireds']!;
  String get notYet => _localizedStrings['Not yet.']!;
  String get claimTime => _localizedStrings['Claim Time']!;
  String get validTime => _localizedStrings['Valid Time']!;
  String get instructions => _localizedStrings['Instructions']!;
  String get useNow => _localizedStrings['Use Now']!;
  String get use => _localizedStrings['Use']!;
  String get already => _localizedStrings['already']!;
  String get paymentmethod => _localizedStrings['Payment method']!;
  String get expandMore => _localizedStrings['expand more']!;
  String get shrink => _localizedStrings['shrink']!;
  String get more => _localizedStrings['more']!;
  String get originalPrice => _localizedStrings['Original Price']!;
  String get handlingFee => _localizedStrings['Handling Fee']!;
  String get detailDesc => _localizedStrings['DetailDesc']!;
  
  String get verifyPhone => _localizedStrings['verifyPhone']!;
  String get bankRefundProcessing => _localizedStrings['BankRefundProcessing']!;
  String get afterSalesProcessing => _localizedStrings['AfterSalesProcessing']!;
  String get orderDynamic => _localizedStrings['OrderDynamic']!;
  String get warmTips => _localizedStrings['warmTips']!;
  String get goModify => _localizedStrings['goModify']!;
  String get confirmCorrect => _localizedStrings['confirmCorrect']!;
  String get verifyEmail => _localizedStrings['verifyEmail']!;
  String get verifyPhoneForSecurity => _localizedStrings['verifyPhoneForSecurity']!;
  String get cancelOrderReasonTitle => _localizedStrings['cancelOrderReasonTitle']!;
  String get cancelOrderReason1 => _localizedStrings['cancelOrderReason1']!;
  String get cancelOrderReason2 => _localizedStrings['cancelOrderReason2']!;
  String get cancelOrderReason3 => _localizedStrings['cancelOrderReason3']!;
  String get cancelOrderReason4 => _localizedStrings['cancelOrderReason4']!;
  String get cancelOrderReason5 => _localizedStrings['cancelOrderReason5']!;
  String get existingCouponCode => _localizedStrings['existingCouponCode']!;
  String get redeemNow => _localizedStrings['redeemNow']!;
  String get redeemCoupon => _localizedStrings['redeemCoupon']!;
  String get enterCouponCode => _localizedStrings['enterCouponCode']!;
  String get noAvailable => _localizedStrings['NoAvailable']!;
  String get noMatchingProducts => _localizedStrings['NoMatchingProducts']!;
  
  String get emailVerificationTips => _localizedStrings['emailVerificationTips']!;
  String get phoneVerificationTips => _localizedStrings['phoneVerificationTips']!;
  String get verifyEmailForSecurity => _localizedStrings['verifyEmailForSecurity']!;
  String get verificationCodeToPhone => _localizedStrings['verificationCodeToPhone']!;
  String get verificationCodeToEmail => _localizedStrings['verificationCodeToEmail']!;
  
  String get selectVerificationMethod => _localizedStrings['selectVerificationMethod']!;
  String get verifyForAccountSecurity => _localizedStrings['verifyForAccountSecurity']!;
  String get chooseVerificationMethod => _localizedStrings['chooseVerificationMethod']!;
  String get verifyBySms => _localizedStrings['verifyBySms']!;
  String get verifyByEmail => _localizedStrings['verifyByEmail']!;
  String get identityVerification => _localizedStrings['identityVerification']!;
  
  String get securityPrivacyConcern => _localizedStrings['securityPrivacyConcern']!;
  String get redundantAccount => _localizedStrings['redundantAccount']!;
  String get shoppingDifficulty => _localizedStrings['shoppingDifficulty']!;
  String get cannotChangeUsername => _localizedStrings['cannotChangeUsername']!;
  String get otherReason => _localizedStrings['otherReason']!;
  String get selectLogoutReason => _localizedStrings['selectLogoutReason']!;
  String get describeOtherReason => _localizedStrings['describeOtherReason']!;
  
  String getString(String key) {
    return _localizedStrings[key] ?? key;
  }
  String get payable => _localizedStrings['Payable']!;
  String get available => _localizedStrings['available']!;
  String get changePassword => _localizedStrings['Change Password']!;
  String get changeYourPasswordRegularlyToProtectYourAccount => _localizedStrings['Change your password regularly to protect your account']!;
  String get emailVerification => _localizedStrings['Email Verification']!;
  String get usedForEmailAuthenticationAndSecurity => _localizedStrings['Used for email authentication and security']!;
  String get verifyNow => _localizedStrings['Verify Now']!;
  String get phoneBinding => _localizedStrings['Phone Binding']!;
  String get bindYourPhoneToLogInQuicklyWithYourNumber => _localizedStrings['Bind your phone to log in quickly with your number']!;
  String get bindNow => _localizedStrings['Bind Now']!;
  String get bind => _localizedStrings['Bind']!;
  String get emailAlreadyBind => _localizedStrings['Email Already Bind']!;
  String get phoneAlreadyBind => _localizedStrings['Phone Already Bind']!;
  String get changeAlreadyBind => _localizedStrings['Change Already Phone']!;
  String get thePasswordsEnteredDoNotMatch => _localizedStrings['The passwords entered do not match']!;
  String get balanceDetails => _localizedStrings['Balance Details']!;
  String get theAccountBalanceIsStoredAndDisplayedInUSD => _localizedStrings['The account balance is stored and displayed in USD. When the balance is used, it will be automatically converted to the selected currency']!;
  String get didNotReceiveTheVerificationCode => _localizedStrings['Did not receive the verification code?']!;
  String get serviceGuarantee => _localizedStrings['Service Guarantee']!;
  String get fastProcessing => _localizedStrings['Fast Processing']!;
  String get safeAndReliable => _localizedStrings['Safe and Reliable']!;
  String get priorityCompensation => _localizedStrings['Priority Compensation']!;
  String get fillInRechargeInformation => _localizedStrings['Fill in Recharge Information']!;
  String get rechargeInformation => _localizedStrings['Recharge Information']!;
  String get fillInPurchaseInformation => _localizedStrings['Fill in Purchase Information']!;
  String get purchaseInformation => _localizedStrings['Purchase Information']!;
  String get howToFillInRechargeInformation => _localizedStrings['How to fill in recharge information?']!;
  String get howToCheckATikTokID => _localizedStrings['How to check a TikTok ID?']!;
  String get clickHereToInquire => _localizedStrings['Click here to inquire.']!;
  String get cannotBeEmpty => _localizedStrings['Cannot be empty']!;
  String get switchAccount => _localizedStrings['Switch account']!;
  String get valueReachedLimitr => _localizedStrings['Value reached limitr']!;
  String get balanceDeduction => _localizedStrings['Balance deduction']!;
  String get discountDeduction => _localizedStrings['Discount deduction']!;
  String get pleaseSelectARegion => _localizedStrings['Please select a region']!;
  String get theaccountyou => _localizedStrings['The account you entered is not registered. Click Register Now to become a member.']!;

  String get pendingReceipt => _localizedStrings['Pending Receipt']!;
  String get completed => _localizedStrings['Completeds']!;
  String get canceled => _localizedStrings['Canceled']!;
  String get closed => _localizedStrings['Closed']!;

  String get afterSales => _localizedStrings['AfterSales']!;
  String get afterCompleted => _localizedStrings['After-Completed']!;
  String get goPay => _localizedStrings['go pay']!;
  String get shipment => _localizedStrings['shipment']!;
  String get shipment2 => _localizedStrings['shipment2']!;
  String get orderDetails => _localizedStrings['Order Details']!;
  String get paymentDue => _localizedStrings['Payment due']!;
  String get productDetails => _localizedStrings['Product Details']!;
  String get completeWithin12Hours => _localizedStrings['complete within 12 hours']!;
  String get paymentSuccessfulCustomerServiceIsProcessingYourOrder => _localizedStrings['Payment successful,customer service is processing your order']!;
  String get orderTime => _localizedStrings['Order Time']!;
  String get closeTime => _localizedStrings['Close Time']!;
  String get paymentTime => _localizedStrings['Payment Time']!;
  String get orderAgain => _localizedStrings['Order Again']!;
  String get checkstand => _localizedStrings['checkstand']!;

  String get orderStatus => _localizedStrings['orderStatus']!;
  String get youhuicuxiao => _localizedStrings['youhuicuxiao']!;
  String get dingdanyichang => _localizedStrings['dingdanyichang']!;
  String get miaosha => _localizedStrings['miaosha']!;

  String get pullToRefresh => _localizedStrings['pullToRefresh']!;
  String get releaseToLoad => _localizedStrings['releaseToLoad']!;
  String get loading => _localizedStrings['loading']!;
  String get viewCoupon => _localizedStrings['viewCoupon']!;
  String get selectCoupon => _localizedStrings['SelectCoupon']!;
  String get goShopping => _localizedStrings['goShopping']!;
  String get useNowDiscount => _localizedStrings['useNowDiscount']!;
  String get securityCode => _localizedStrings['securityCode']!;

  String get zhangdandizhi => _localizedStrings['zhangdandizhi']!;
  String get guanlidizhi => _localizedStrings['guanlidizhi']!;
  String get bianji => _localizedStrings['bianji']!;
  String get jisuzhifu => _localizedStrings['jisuzhifu']!;
  String get putongzhifu => _localizedStrings['putongzhifu']!;
  String get kuairenyibu => _localizedStrings['kuairenyibu']!;
  String get quchakan => _localizedStrings['quchakan']!;
  String get noaccount => _localizedStrings['noaccount']!;

  String get jiandanmiaoshu => _localizedStrings['jiandanmiaoshu']!;
  String get bianyulianxi => _localizedStrings['bianyulianxi']!;
  String get banbengengxin => _localizedStrings['banbengengxin']!;
  String get yinsixieyi => _localizedStrings['yinsixieyi']!;
  String get fuwuxieyi => _localizedStrings['fuwuxieyi']!;
  String get benruanjiancanjia => _localizedStrings['benruanjiancanjia']!;
  String get loginout => _localizedStrings['loginout']!;
  String get wumenkan => _localizedStrings['wumenkan']!;
  String get isloginout => _localizedStrings['isloginout']!;
  String get emailsure => _localizedStrings['emailsure']!;
  String get emailsureagain => _localizedStrings['emailsureagain']!;
  String get orderfail => _localizedStrings['orderfail']!;
  String get selectAll => _localizedStrings['selectAll']!;
  String get select => _localizedStrings['select']!;
  String get delete => _localizedStrings['delete']!;
  String get nextone => _localizedStrings['nextone']!;
  String get yonghudenglu => _localizedStrings['yonghudenglu']!;
  String get morepayment => _localizedStrings['morepayment']!;
  String get morepayment2 => _localizedStrings['morepayment2']!;

  String get qingqiuhuidiao => _localizedStrings['qingqiuhuidiao']!;
  String get allMessagesIsRead => _localizedStrings['allMessagesIsRead']!;
  String get newcreateAddress => _localizedStrings['newcreateAddress']!;
  String get noUnreadMessages => _localizedStrings['noUnreadMessages']!;
  String get deleteAddress1 => _localizedStrings['deleteAddress1']!;
  String get deleteAddress2 => _localizedStrings['deleteAddress2']!;
  
  String get fastPayment => _localizedStrings['fastPayment']!;
  String get noQuickPayment => _localizedStrings['noQuickPayment']!;
  String get confirmDeletePayment => _localizedStrings['confirmDeletePayment']!;
  String get paymentDeleteWarning => _localizedStrings['paymentDeleteWarning']!;
  String get lotteryWin => _localizedStrings['LotteryWin']!;
  String get lotteryAutoSave => _localizedStrings['LotteryAutoSave']!;
  String get lotteryGotIt => _localizedStrings['LotteryGotIt']!;
  String get orderUnpaidAlert => _localizedStrings['OrderUnpaidAlert']!;
  String get orderRecommendation => _localizedStrings['OrderRecommendation']!;
  String get changePaymentMethod => _localizedStrings['ChangePaymentMethod']!;
  String get cancelOrderAndRefund => _localizedStrings['CancelOrderAndRefund']!;
  String get isNewVersion => _localizedStrings['isNewVersion']!;
  String get googleSign => _localizedStrings['googleSign']!;
  String get lineSign => _localizedStrings['lineSign']!;
  String get appleSign => _localizedStrings['appleSign']!;  
  String get profileOrder => _localizedStrings['profileOrder']!;

  String get noneOrder => _localizedStrings['NoneOrder']!;
  String get noneOrder2 => _localizedStrings['NoneOrder2']!;
  String get noneOrder3 => _localizedStrings['NoneOrder3']!;
  String get unitPrice => _localizedStrings['unitPrice']!;
  String get orderInfo => _localizedStrings['orderInfo']!;
  String get confirmOrder => _localizedStrings['Confirm Order']!;
  String get confirmAccount => _localizedStrings['Confirm Account']!;
  String get useDiscounts => _localizedStrings['Coupon Discounts']!;
  String get couponDiscounts => _localizedStrings['couponDiscounts']!;
  String get couponDiscountsNo => _localizedStrings['couponDiscountsNo']!;
  String get submitOrder => _localizedStrings['submitOrder']!;
  String get selectRechargeAccount => _localizedStrings['Select recharge Account']!;
  String get dyInputText1 => _localizedStrings['dyInputText1']!;
  String get dyInputText2 => _localizedStrings['dyInputText2']!;
  String get securityAssurance => _localizedStrings['Security Assurance']!;
  String get clickSubmitOrder => _localizedStrings['clickSubmitOrder']!;
  String get newUserBonus => _localizedStrings['New User Bonus']!;
  String get welcomeBonus => _localizedStrings['Welcome Bonus']!;
  String get signUp => _localizedStrings['Sign Up']!;
  String get cardInfo => _localizedStrings['CardInfo']!;
  String get clickToLoad => _localizedStrings['clickToLoad']!;
  String get orderNumberIs => _localizedStrings['orderNumberIs']!;
  String get orderNumberIs2 => _localizedStrings['orderNumberIs2']!;
  String get discount1 => _localizedStrings['discount1']!;
  String get discount2 => _localizedStrings['discount2']!;
  String get discount3 => _localizedStrings['discount3']!;
  String get edeemOffer => _localizedStrings['edeemOffer']!;
  String get claimAll => _localizedStrings['claimAll']!;
  String get totalof => _localizedStrings['totalof']!;
  String get items => _localizedStrings['items']!;
  String get cavailable => _localizedStrings['cavailable']!;
  String get defaultsa => _localizedStrings['default']!;
  String get search => _localizedStrings['search']!;
  String get pleaseEnterProductName => _localizedStrings['Please enter product name']!;
  String get noProductFound => _localizedStrings['noProductFound']!;
  String get noProductFound1 => _localizedStrings['noProductFound1']!;
  String get noProductFound2 => _localizedStrings['noProductFound2']!;
  String get noProductFound3 => _localizedStrings['noProductFound3']!;
  String get noProductFound4 => _localizedStrings['noProductFound4']!;
  String get noProductFound5 => _localizedStrings['noProductFound5']!;
  String get redeem => _localizedStrings['Redeem']!;
  String get recharge1 => _localizedStrings['recharge1']!;
  String get recharge2 => _localizedStrings['recharge2']!;
  String get recharge3 => _localizedStrings['recharge3']!;
  String get recharge4 => _localizedStrings['recharge4']!;
  String get recharge5 => _localizedStrings['recharge5']!;
  String get recharge6 => _localizedStrings['recharge6']!;
  String get recharge7 => _localizedStrings['recharge7']!;
  String get changePassword1 => _localizedStrings['changePassword1']!;
  String get changePassword2 => _localizedStrings['changePassword2']!;
  String get changePassword3 => _localizedStrings['changePassword3']!;
  String get changePassword4 => _localizedStrings['changePassword4']!;
  String get changePassword5 => _localizedStrings['changePassword5']!;
  String get changePassword6 => _localizedStrings['changePassword6']!;
  String get registerBonus => _localizedStrings['registerBonus']!;
  String get placeOrder => _localizedStrings['placeOrder']!;
  String get logout1 => _localizedStrings['logout1']!;
  String get logout2 => _localizedStrings['logout2']!;
  String get logout3 => _localizedStrings['logout3']!;
  String get logout4 => _localizedStrings['logout4']!;
  String get contact => _localizedStrings['contact']!;
  String get cardpayment => _localizedStrings['cardpayment']!;
  String get productNo => _localizedStrings['productNo']!;
  String get productNoBack => _localizedStrings['productNoBack']!;
  String get productNo2 => _localizedStrings['productNo2']!;
  String get howtor => _localizedStrings['howtor']!;
  String get soldout => _localizedStrings['soldout']!;
  String get blurbNoText => _localizedStrings['blurbNoText']!;
}

class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
  const _AppLocalizationsDelegate();

  @override
  bool isSupported(Locale locale) {
    // 支持 zh_CN, zh_TW, en（或 en_US）
    if (locale.languageCode == 'zh' && (locale.countryCode == 'CN' || locale.countryCode == 'TW')) {
      return true;
    }
    if (locale.languageCode == 'en') {
      return true;
    }
    return false;
  }
  @override
  Future<AppLocalizations> load(Locale locale) {
    return AppLocalizations.load(locale);
  }

  @override
  bool shouldReload(_AppLocalizationsDelegate old) => false;
}
